Skip to content

Preliminary support for Matter cover#90262

Merged
marcelveldt merged 11 commits into
home-assistant:devfrom
hidaris:add_matter_cover
Apr 4, 2023
Merged

Preliminary support for Matter cover#90262
marcelveldt merged 11 commits into
home-assistant:devfrom
hidaris:add_matter_cover

Conversation

@hidaris
Copy link
Copy Markdown
Contributor

@hidaris hidaris commented Mar 25, 2023

Proposed change

This PR adds matter cover control feature. Curtain tilt support has not been added yet.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hi @hidaris

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of matter can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign matter Removes the current integration label and assignees on the pull request, add the integration domain after the command.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add tests. See the other platforms for examples of tests using the diagnostic dumps stored as fixtures.

Comment thread homeassistant/components/matter/cover.py Outdated
Comment thread homeassistant/components/matter/cover.py Outdated
Comment thread homeassistant/components/matter/cover.py Outdated
Comment thread homeassistant/components/matter/cover.py Outdated
Comment thread homeassistant/components/matter/cover.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft March 27, 2023 09:53
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Comment thread homeassistant/components/matter/cover.py Outdated
@marcelveldt
Copy link
Copy Markdown
Member

Hi @hidaris do you have time/interest to address the feedback comments or may/can I help you finishing it ?

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Mar 29, 2023

Hi @hidaris do you have time/interest to address the feedback comments or may/can I help you finishing it ?

Most of the feedbacks I've fixed locally, but because of the network in my region, the tests I've added don't have environmental testing at the moment, and I'm working on that...

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Mar 29, 2023

I added the test, but it keeps telling me I don't have the entity id, I used flag --snapshot-update, but it didn't solve the problem, can anyone tell me what's wrong?

Comment thread homeassistant/components/matter/cover.py Outdated
Comment thread homeassistant/components/matter/cover.py Outdated
@MartinHjelmare
Copy link
Copy Markdown
Member

If you address the lint issues we can run CI again and see the error message of the pytest tests, and figure out what's wrong. I'm guessing the entity_id may be incorrect.

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Mar 30, 2023

If you address the lint issues, we can rerun CI and see the pytest error message and figure out what is wrong. I suspect that the entity_id might be wrong.

I just pushed the fix

@MartinHjelmare
Copy link
Copy Markdown
Member

Please also address the lint issues: ruff, isort and pylint
Click on the jobs to view the logs and what's wrong.

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Mar 30, 2023

Please also address the lint issues: ruff, isort and pylint Click on the jobs to view the logs and what's wrong.

Please also address the lint issues: ruff, isort and pylint Click on the jobs to view the logs and what's wrong.

I adjusted the ruff and isort issue, pylint says I have a problem with intflag, I'm not sure if that's a problem

@MartinHjelmare
Copy link
Copy Markdown
Member

The entity_id seems to be cover.longan_link_wncv_da01. It's logged if you read the CI log.

Comment thread homeassistant/components/matter/discovery.py Outdated
@MartinHjelmare
Copy link
Copy Markdown
Member

Tests are still failing but for another reason now. Not sure what's wrong.

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Mar 30, 2023

Tests are still failing but for another reason now. Not sure what's wrong.

It was a problem with the test fixture, available was not set to true, and then I found that the window state tests added to the previous test depended on the operational status of the subscription, which was not updated correctly during the mock, so I removed them.

@MartinHjelmare
Copy link
Copy Markdown
Member

Can't we set the operational status attribute too in the test so we can test all possible states?

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Mar 31, 2023

Can't we set the operational status attribute too in the test so we can test all possible states?

Yes, I added it

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Mar 31, 2023

CI says docs-missing, does this need to be fixed?

@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Mar 31, 2023

Yes, please link a docs PR with an addition of the new platform to the ha_platforms front matter at the top of the page.

https://www.home-assistant.io/integrations/matter/

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Apr 4, 2023

Yes, please link a docs PR with an addition of the new platform to the ha_platforms front matter at the top of the page.

https://www.home-assistant.io/integrations/matter/

I just updated the documentation home-assistant/home-assistant.io#26857

Comment thread homeassistant/components/matter/cover.py Outdated
Comment thread homeassistant/components/matter/cover.py Outdated
Comment thread homeassistant/components/matter/cover.py Outdated
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@hidaris hidaris marked this pull request as ready for review April 4, 2023 09:57
@home-assistant home-assistant Bot requested a review from MartinHjelmare April 4, 2023 09:57
Copy link
Copy Markdown
Member

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for your contribution !

@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Apr 4, 2023

@marcelveldt Just wondering if you're working on the Thermostat cluster? I've got some free time next week and was thinking of giving it a shot.

@marcelveldt
Copy link
Copy Markdown
Member

marcelveldt commented Apr 4, 2023

@marcelveldt Just wondering if you're working on the Thermostat cluster? I've got some free time next week and was thinking of giving it a shot.

Yes, I am. I'll drop a PR for that this week.
Which device do you have/own ? Because thermostat/climate devices are pretty extended so would be good to test a few devices

@marcelveldt marcelveldt merged commit a9e14cd into home-assistant:dev Apr 4, 2023
@emontnemery emontnemery mentioned this pull request Apr 4, 2023
20 tasks
@hidaris
Copy link
Copy Markdown
Contributor Author

hidaris commented Apr 4, 2023

@marcelveldt Just wondering if you're working on the Thermostat cluster? I've got some free time next week and was thinking of giving it a shot.

Yes, I am. I'll drop a PR for that this week. Which device do you have/own ? Because thermostat/climate devices are pretty extended so would be good to test a few devices

Looking forward to it! As a non-native English speaker, my description of the device may not be entirely accurate, but to me it is a control panel for central air conditioning. In the matter specification, it corresponds to the thermostat under HVAC.

@github-actions github-actions Bot locked and limited conversation to collaborators Apr 5, 2023
@frenck frenck added the noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) label Apr 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed integration: matter new-feature new-platform noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) Quality Scale: No score

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants